<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>fdk-aac: original/libFDK/src/dct.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">fdk-aac
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_ed137715e08969a186ec660e8ae6e2fb.html">original</a></li><li class="navelem"><a class="el" href="dir_28764f9257266d97c7295693d7c6996f.html">libFDK</a></li><li class="navelem"><a class="el" href="dir_25dde5328027b7c94f7c7b75e3f8d6f2.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">dct.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>DCT Implementations Library functions to calculate standard DCTs. This will most likely be replaced by hand-optimized functions for the specific target processor.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;dct.h&quot;</code><br />
<code>#include &quot;FDK_tools_rom.h&quot;</code><br />
<code>#include &quot;fft.h&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a406e6d76898ef7c4f76bd1e326a27ae3"><td class="memItemLeft" align="right" valign="top"><a id="a406e6d76898ef7c4f76bd1e326a27ae3"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>dct_getTables</b> (const FIXP_WTP **ptwiddle, const FIXP_STP **sin_twiddle, int *sin_step, int length)</td></tr>
<tr class="separator:a406e6d76898ef7c4f76bd1e326a27ae3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa64b5480610198c4be388ac9e00d660e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dct_8cpp.html#aa64b5480610198c4be388ac9e00d660e">dct_III</a> (FIXP_DBL *pDat, FIXP_DBL *tmp, int L, int *pDat_e)</td></tr>
<tr class="memdesc:aa64b5480610198c4be388ac9e00d660e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate DCT type III of given length. The DCT IV is calculated by a complex FFT, with some pre and post twiddeling. Note that the factor 0.5 for the sum term x[0] is 1.0 instead of 0.5. A factor of sqrt(2/N) is NOT applied.  <a href="dct_8cpp.html#aa64b5480610198c4be388ac9e00d660e">More...</a><br /></td></tr>
<tr class="separator:aa64b5480610198c4be388ac9e00d660e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8988bb999dc36c4aa73db0af67125e2e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dct_8cpp.html#a8988bb999dc36c4aa73db0af67125e2e">dst_III</a> (FIXP_DBL *pDat, FIXP_DBL *tmp, int L, int *pDat_e)</td></tr>
<tr class="memdesc:a8988bb999dc36c4aa73db0af67125e2e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate DST type III of given length. The DST III is calculated by a DCT III of mirrored input and sign-flipping of odd output coefficients. Note that the factor 0.5 for the sum term x[N-1] is 1.0 instead of 0.5. A factor of sqrt(2/N) is NOT applied.  <a href="dct_8cpp.html#a8988bb999dc36c4aa73db0af67125e2e">More...</a><br /></td></tr>
<tr class="separator:a8988bb999dc36c4aa73db0af67125e2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c2ceab3c00b6b0565af5670f7b3711d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dct_8cpp.html#a0c2ceab3c00b6b0565af5670f7b3711d">dct_II</a> (FIXP_DBL *pDat, FIXP_DBL *tmp, int L, int *pDat_e)</td></tr>
<tr class="memdesc:a0c2ceab3c00b6b0565af5670f7b3711d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate DCT type II of given length. The DCT IV is calculated by a complex FFT, with some pre and post twiddeling. A factor of sqrt(2/(N-1)) is NOT applied.  <a href="dct_8cpp.html#a0c2ceab3c00b6b0565af5670f7b3711d">More...</a><br /></td></tr>
<tr class="separator:a0c2ceab3c00b6b0565af5670f7b3711d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89c8a8c381cb852b50ec35976dac9f09"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dct_8cpp.html#a89c8a8c381cb852b50ec35976dac9f09">dct_IV</a> (FIXP_DBL *pDat, int L, int *pDat_e)</td></tr>
<tr class="memdesc:a89c8a8c381cb852b50ec35976dac9f09"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate DCT type IV of given length. The DCT IV is calculated by a complex FFT, with some pre and post twiddeling. A factor of sqrt(2/N) is NOT applied.  <a href="dct_8cpp.html#a89c8a8c381cb852b50ec35976dac9f09">More...</a><br /></td></tr>
<tr class="separator:a89c8a8c381cb852b50ec35976dac9f09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e7e10722423a58d33cafa4db0459252"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dct_8cpp.html#a6e7e10722423a58d33cafa4db0459252">dst_IV</a> (FIXP_DBL *pDat, int L, int *pDat_e)</td></tr>
<tr class="memdesc:a6e7e10722423a58d33cafa4db0459252"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate DST type IV of given length. The DST IV is calculated by a complex FFT, with some pre and post twiddeling. A factor of sqrt(2/N) is NOT applied.  <a href="dct_8cpp.html#a6e7e10722423a58d33cafa4db0459252">More...</a><br /></td></tr>
<tr class="separator:a6e7e10722423a58d33cafa4db0459252"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>DCT Implementations Library functions to calculate standard DCTs. This will most likely be replaced by hand-optimized functions for the specific target processor. </p>
<p>Three different implementations of the dct type II and the dct type III transforms are provided.</p>
<p>By default implementations which are based on a single, standard complex FFT-kernel are used (dctII_f() and dctIII_f()). These are specifically helpful in cases where optimized FFT libraries are already available. The FFT used in these implementation is FFT rad2 from FDK_tools.</p>
<p>Of course, one might also use DCT-libraries should they be available. The DCT and DST type IV implementations are only available in a version based on a complex FFT kernel. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a0c2ceab3c00b6b0565af5670f7b3711d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c2ceab3c00b6b0565af5670f7b3711d">&#9670;&nbsp;</a></span>dct_II()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dct_II </td>
          <td>(</td>
          <td class="paramtype">FIXP_DBL *&#160;</td>
          <td class="paramname"><em>pDat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FIXP_DBL *&#160;</td>
          <td class="paramname"><em>tmp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>pDat_e</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate DCT type II of given length. The DCT IV is calculated by a complex FFT, with some pre and post twiddeling. A factor of sqrt(2/(N-1)) is NOT applied. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pDat</td><td>pointer to input/output data (in place processing). </td></tr>
    <tr><td class="paramname">size</td><td>size of pDat. </td></tr>
    <tr><td class="paramname">pDat_e</td><td>pointer to an integer containing the exponent of the data referenced by pDat. The exponent is updated accordingly. </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pDat</td><td>pointer to input/output </td></tr>
    <tr><td class="paramname">tmp</td><td>pointer to temporal working buffer </td></tr>
    <tr><td class="paramname">L</td><td>lenght of transform (has to be a multiple of 8 (or 4 in case DCT_II_L_MULTIPLE_OF_4_SUPPORT is defined) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aa64b5480610198c4be388ac9e00d660e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa64b5480610198c4be388ac9e00d660e">&#9670;&nbsp;</a></span>dct_III()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dct_III </td>
          <td>(</td>
          <td class="paramtype">FIXP_DBL *&#160;</td>
          <td class="paramname"><em>pDat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FIXP_DBL *&#160;</td>
          <td class="paramname"><em>tmp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>pDat_e</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate DCT type III of given length. The DCT IV is calculated by a complex FFT, with some pre and post twiddeling. Note that the factor 0.5 for the sum term x[0] is 1.0 instead of 0.5. A factor of sqrt(2/N) is NOT applied. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pDat</td><td>pointer to input/output data (in place processing). </td></tr>
    <tr><td class="paramname">size</td><td>size of pDat. </td></tr>
    <tr><td class="paramname">pDat_e</td><td>pointer to an integer containing the exponent of the data referenced by pDat. The exponent is updated accordingly. </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pDat</td><td>pointer to input/output </td></tr>
    <tr><td class="paramname">tmp</td><td>pointer to temporal working buffer </td></tr>
    <tr><td class="paramname">L</td><td>lenght of transform </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a89c8a8c381cb852b50ec35976dac9f09"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a89c8a8c381cb852b50ec35976dac9f09">&#9670;&nbsp;</a></span>dct_IV()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dct_IV </td>
          <td>(</td>
          <td class="paramtype">FIXP_DBL *&#160;</td>
          <td class="paramname"><em>pDat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>pDat_e</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate DCT type IV of given length. The DCT IV is calculated by a complex FFT, with some pre and post twiddeling. A factor of sqrt(2/N) is NOT applied. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pDat</td><td>pointer to input/output data (in place processing). </td></tr>
    <tr><td class="paramname">size</td><td>size of pDat. </td></tr>
    <tr><td class="paramname">pDat_e</td><td>pointer to an integer containing the exponent of the data referenced by pDat. The exponent is updated accordingly. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a8988bb999dc36c4aa73db0af67125e2e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8988bb999dc36c4aa73db0af67125e2e">&#9670;&nbsp;</a></span>dst_III()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dst_III </td>
          <td>(</td>
          <td class="paramtype">FIXP_DBL *&#160;</td>
          <td class="paramname"><em>pDat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FIXP_DBL *&#160;</td>
          <td class="paramname"><em>tmp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>pDat_e</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate DST type III of given length. The DST III is calculated by a DCT III of mirrored input and sign-flipping of odd output coefficients. Note that the factor 0.5 for the sum term x[N-1] is 1.0 instead of 0.5. A factor of sqrt(2/N) is NOT applied. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pDat</td><td>pointer to input/output data (in place processing). </td></tr>
    <tr><td class="paramname">size</td><td>size of pDat. </td></tr>
    <tr><td class="paramname">pDat_e</td><td>pointer to an integer containing the exponent of the data referenced by pDat. The exponent is updated accordingly. </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pDat</td><td>pointer to input/output </td></tr>
    <tr><td class="paramname">tmp</td><td>pointer to temporal working buffer </td></tr>
    <tr><td class="paramname">L</td><td>lenght of transform </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a6e7e10722423a58d33cafa4db0459252"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e7e10722423a58d33cafa4db0459252">&#9670;&nbsp;</a></span>dst_IV()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dst_IV </td>
          <td>(</td>
          <td class="paramtype">FIXP_DBL *&#160;</td>
          <td class="paramname"><em>pDat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>pDat_e</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate DST type IV of given length. The DST IV is calculated by a complex FFT, with some pre and post twiddeling. A factor of sqrt(2/N) is NOT applied. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pDat</td><td>pointer to input/output data (in place processing). </td></tr>
    <tr><td class="paramname">size</td><td>size of pDat. </td></tr>
    <tr><td class="paramname">pDat_e</td><td>pointer to an integer containing the exponent of the data referenced by pDat. The exponent is updated accordingly. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
